C++ Overview
Volume Number: 5
Issue Number: 9
Column Tag: Jörg's Folder
C++ Overview
By Jörg Langowski, MacTutor Editorial Staff
“An Overview Of C++”
MacHack ’89 brought me not only a colorful set of screwdrivers from APDA, but
also a new assignment: yours truly is supposed to run a tutorial column on C++. C++
is a very interesting programming language. Supposedly, the new Finder was written
in it. Also, it exists on a couple of Unix systems. In fact, shopping for a Unix system,
we recently met a representative who assured us that C++ would be delivered with the
system. Jordan Matthews, and other people from Apple, spoke very highly about C++
at the MacHack, and assured us that we would get our fingers on a pre-release of
Apple’s C++ for MPW, supposedly to be delivered by the end of this year.
As you might have guessed, Apple hasn’t sent us the pre-release yet, and I have
yet to use a working C++ compiler. So far my only ‘hands-on’ experience is Bjarne
Stroustrup’s book, The C++ Programming Language (Addison-Wesley 1987), which I
highly recommend.
The style of the book is rather terse, and you have to work your way through. A
good example is that after the introduction, not much is said about ‘object-oriented’
programming, until you hit page 213:
“A list specified in terms of pointers to a class can hold objects of any class
derived from that class. That is, it may be heterogeneous. This is probably the single
most important and useful aspect of derived classes, and it is essential in the style of
programming presented in the following example. That style of programming is often
called object based or object oriented; it relies on operations applied in a uniform
manner to objects on heterogeneous lists.”
So now you know what you’ve really done when you used MacApp The fact that
Stroustrup refers to object-oriented programming in this rather abstract way made
me dig out an old introduction to Simula 67, which was the first language to introduce
object-oriented concepts. There, too (the book dates from 1973) no reference is made
to OOP as we know it today. All the important constructs - classes, instances, methods,
overriding - are already there, and one could have implemented today’s programming
style in Simula; only computers were much smaller, and most programs did not
demand OOP concepts.
The C++ Design
Stroustrup’s team designed C++ for dealing with simulation problems not unlike
those that Simula was developed for. However, C++ is a much broader concept than
simply a set of ‘object-oriented’ extensions to C; it is a redesign of the C language. To
use another quotation from Stroustrup’s book, “C++ was designed to enable larger